<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <!-- 一个函数有传入3个参数 ，3个参数都是数值 ，把参数组装成数组返还，数组需要是由大到小 。（尽量不要超纲）; -->

    <script>
      function fn(a, b, c) {
        var min = arguments[0];
        var max = arguments[0];
        var mid = arguments[0];
        for (i = 1; i < arguments.length; i++) {
          if (arguments[i] < min) {
            min = arguments[i];
          }

          if (arguments[i] > max) {
            max = arguments[i];
          }
        }
        // console.log(min + "最小值");
        // console.log(max + "最大值");
        for (j = 1; j < arguments.length; j++) {
          if (min <= arguments[j] && arguments[j] < max) {
            mid = arguments[j];
            console.log(mid);
          }
        }
        return [max, mid, min];
      }
      var res = fn(6, 15, 33);
      console.log(res);
    </script>
  </body>
</html>
